const information = document.getElementById('info')
information.innerText = `本应用正在使用 Chrome (v${versions.chrome()}  v8-v${versions.v8}), Node.js (v${versions.node()}), 和 Electron (v${versions.electron()})`

const timeStr = document.getElementById('time')

const func = async () => {
    const response = await window.versions.ping()
    // console.log(response)
    timeStr.innerText = response
}
setInterval(func, 1000);

document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
    const isDarkMode = await window.darkMode.toggle();
    document.getElementById('theme-source').innerHTML = isDarkMode ? 'Dark' : 'Light'
})

document.getElementById('reset-to-system').addEventListener('click', async () => {
    await window.darkMode.system();
    document.getElementById('theme-source').innerHTML = 'System'
})